package router

import (
	platformController "gitee.com/wangshh_123/cross-pay-go/src/controller/platform"
	"gitee.com/wangshh_123/cross-pay-go/src/middleware"
	"github.com/gin-gonic/gin"
)

// SetupCardBinRouter 设置统一的卡BIN路由
func SetupCardBinRouter(api *gin.RouterGroup) {
	// 创建统一的卡BIN控制器实例
	cardBinController := platformController.NewCardBinController()

	// 卡BIN路由组
	cardBin := api.Group("/card-bin")
	{
		// 基础卡BIN查询 - 根据用户平台自动选择
		cardBin.GET("/", middleware.AuthMiddleware(), middleware.PlatformInfoMiddleware(), cardBinController.GetCardBin)

		// 指定平台查询 - 管理员功能
		cardBin.GET("/platform/:platform", middleware.AuthMiddleware(), cardBinController.GetCardBinByPlatform)

		// 平台对比查询 - 高级功能
		cardBin.GET("/comparison", middleware.AuthMiddleware(), cardBinController.GetCardBinComparison)

		// 获取支持的平台列表
		cardBin.GET("/platforms", cardBinController.GetSupportedPlatforms)

		// 获取指定平台信息
		cardBin.GET("/platform/:platform/info", cardBinController.GetPlatformInfo)
	}
}
